package com.tea.admin.modules.app.controller;

import com.tea.admin.modules.app.dto.DashboardData;
import com.tea.admin.modules.app.service.DashboardService;

import com.tea.common.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 数据统计面板Controller
 */
@Api(tags = "数据统计")
@RestController
@RequestMapping("/app/dashboard")
@RequiredArgsConstructor
public class DashboardController {

    private final DashboardService dashboardService;

    @ApiOperation("获取面板统计数据")
    @GetMapping("/panel")
    public CommonResult<DashboardData> getPanelData() {
        return CommonResult.success(dashboardService.getPanelData());
    }
}
